<?php

namespace App\Http\Controllers\Index;

use App\Model\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class LoginController extends Controller
{
    //登录操作
    public function login(Request $request) {
        $phone = $request->get('phone');
        $pass = $request->get('password');
        $res = User::where(['phone' => $phone, 'pass' => $pass])->get()->toArray();
        if ($res) {
            return '登录成功';
        } else {
            return redirect('index');
        }
    }
}
